package  
{
	import org.flixel.*;
	import AssetManager;
	import ConfigData;
	
	public class HeartParticle extends FlxParticle
	{
		private var _index:int = 0;
		private var _age:Number = 0;
		public var doneFlying:Boolean = false;
		
		public function HeartParticle(index:int ) 
		{
			_index = index;
			super();
			loadGraphic(AssetManager.HeartSmall);
		}
		
		override public function onEmit():void 
		{
			var r:Number = Math.random();
			if (r < 0.33){
				FlxG.play(AssetManager.Bubble1SFX);
			} else if (r < 0.66) {
				FlxG.play(AssetManager.Bubble2SFX);
			} else {
				FlxG.play(AssetManager.Bubble3SFX);
			}
		}
		
		//override public function update():void 
		//{
			//if (doneFlying)
				//return;
			//super.update();
			//_age += FlxG.elapsed;
			//
			// We've floated for long enough, zero everything out and put me in position
			//if (_age > ConfigData.HEARTS_FLOAT_TIME)
			//{
				//x = _index * (width + 1);
				//y = Math.ceil(x / FlxG.width * (height + 1));
				//x = x % FlxG.width;
				//velocity = new FlxPoint(0, 0);
				//acceleration = new FlxPoint(0, 0);
				//angularAcceleration = 0;
				//angularVelocity = 0;
				//angle = 0;
				//scrollFactor = new FlxPoint(0, 0);
				//doneFlying = true;
				//if (_index >= ConfigData.NUMBER_OF_HEARTS_TO_COLLET-1)
				//{
					//PlayState(FlxG.state).youWon();
				//}
			//}
		//}
		
	}

}